package com.qd.common.panda.domain.entity.stroke;

import com.cdqidi.util.page.BaseQuery;
import com.cdqidi.valid.group.DefaultGroup;
import com.cdqidi.valid.group.DeleteGroup;
import com.cdqidi.valid.group.UpdateGroup;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 退款信息
 *
 * @author sjk
 */
@EqualsAndHashCode(callSuper = true)
@Getter
@Setter
public class UserStrokeOrderRefundDTO extends BaseQuery {

    /**
     * 主键
     */
    @NotBlank(message = "退款ID不能为空", groups = {DeleteGroup.class, UpdateGroup.class})
    @Size(max = 50, message = "退款ID长度不能超过{max}位", groups = {DeleteGroup.class, UpdateGroup.class})
    private String refundId;
    /**
     * 实际支付金额
     */
    @NotNull(message = "实际支付金额不能为空", groups = DefaultGroup.class)
    private BigDecimal payAmount;
    /**
     * 实际支付金额显示
     */
    private String payAmountDisplay;
    /**
     * 退款金额
     */
    @NotNull(message = "退款金额不能为空", groups = DefaultGroup.class)
    private BigDecimal refundAmount;
    /**
     * 退款金额显示
     */
    private String refundAmountDisplay;
    /**
     * 退款时间
     */
    @NotNull(message = "退款时间不能为空", groups = DefaultGroup.class)
    private LocalDateTime refundTime;
    /**
     * 退款状态:1退款成功 2退款失败
     */
    @NotNull(message = "退款状态不能为空", groups = DefaultGroup.class)
    private Integer refundStatus;
    /**
     * 退款状态显示
     */
    private String refundStatusDisplay;
    /**
     * 订单ID
     */
    @NotBlank(message = "订单ID不能为空", groups = DefaultGroup.class)
    @Size(max = 50, message = "订单ID长度不能超过{max}位", groups = DefaultGroup.class)
    private String orderId;
    /**
     * 行程ID
     */
    @NotBlank(message = "行程ID不能为空", groups = DefaultGroup.class)
    @Size(max = 50, message = "行程ID长度不能超过{max}位", groups = DefaultGroup.class)
    private String sid;
    /**
     * 编号:如果有多笔退款的时候从1开始编号
     */
    private Integer refundNo;
    /**
     * 业务ID,对应订单表中的第三方订单号
     */
    private String bid;

    @Override
    public void freeData() {
        this.refundId = null;
        this.payAmount = null;
        this.payAmountDisplay = null;
        this.refundAmount = null;
        this.refundAmountDisplay = null;
        this.refundTime = null;
        this.refundStatus = null;
        this.refundStatusDisplay = null;
        this.orderId = null;
        this.sid = null;
        this.refundNo = null;
        this.bid = null;
        super.freeData();
    }
}
